package com.tools.sqlmaker.util;

import cn.hutool.core.io.FileUtil;

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;

/**
 * @author: zhoubin
 * @date: 2023/9/27
 */
public class BaseFileUtil {

    public static void writeFile(File file, List<String> allList) {
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        FileUtil.writeLines(allList, file, Charset.defaultCharset());
    }
}
